<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<% String path = request.getContextPath();
request.setAttribute("path",path);%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>酒店管理系统 - 客房评价管理列表</title>
	<meta name="keywords" content="">
	<meta name="description" content="">

	<link rel="shortcut icon" href="favicon.ico">
	<link href="${path}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="${path}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<!-- Data Tables -->
	<link href="${path}/css/plugins/dataTables/dataTables.bootstrap.css"
		rel="stylesheet">
	<link href="${path}/css/animate.css" rel="stylesheet">
	<link href="${path}/css/style.css?v=4.1.0" rel="stylesheet">
	
	<link rel="stylesheet" type="text/css" href="${path}/dist/sweetalert.css">
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>客房评价管理列表</h5>
					</div>
					<div class="ibox-content">
						<table class="table table-striped table-bordered table-hover dataTables-example">
							<div style="font-size:18px">
								<form action="/TbEva/tbEvaPage" method="post" >
								审核状态:<select name="app_status" value="">
								<option value="" <c:if test="${app_status==3}"> selected</c:if>>全部</option>
								<option value="0" <c:if test="${app_status==0}"> selected</c:if>>未审核</option>
								<option value="1" <c:if test="${app_status==1}"> selected</c:if>>已审核</option>
							</select>
								<input type="submit" value="查询" style="font-size:15px">
							</form>
							<a href="##" onclick="passChecked()">一键审核</a>
							<a href="##" onclick="delChecked()">一键删除</a>
							</div>

							<thead>
								<tr>
									<th><input type="checkbox"  onclick="allChecked()"/></th>
									<th>序号</th>
									<th>评价内容</th>
									<th>评价日期</th>
									<th>用户id</th>
									<th>是否匿名(0,不匿名 1,匿名 )</th>
									<th>客房id</th>
									<th>审核状态(0,未审核 1,审核)</th>
									<td>星数</td>
									<td>点赞数量</td>
									<th>操作</th>
								</tr>
							</thead>

							<tbody>
							<tbody>
								<c:forEach items="${page.list}" var="eva" varStatus="k">
									<tr class="gradeA">
										<td><input type="checkbox" name="evaIndex" value="${eva.id}" /></td>
										<td>${k.count}</td>
										<td>${eva.evaContent}</td>
										<td>${eva.evaTime}</td>
										<td>${eva.userId}</td>
										<td>
											<c:if test="${eva.isNm=='0'}">不匿名</c:if>
											<c:if test="${eva.isNm=='1'}">匿名</c:if>
										</td>
										<td>${eva.kfId}</td>
										<td>
											<c:if test="${eva.appStatus==0}">未审核</c:if>
											<c:if test="${eva.appStatus==1}">已审核</c:if>
										</td>
										<td>${eva.evaClass}</td>
										<td>${eva.dzNum}</td>
										<td>
<%--											<a href="${path}/kfRoom/delKfRoom?id=${kfRoom.id}" class="btn btn-primary">添加图片</a>--%>
											<a href="${path}/TbEva/updEva?id=${eva.id}" class="btn btn-primary">审核</a>&nbsp;&nbsp;
											<a href="${path}/TbEva/delEva?id=${eva.id}" class="btn btn-danger">删除</a>
										</td>

									</tr>
								</c:forEach>
							</tbody>
						</table>
						<div>
							<span style="float: left; padding: 5px">
								当前&nbsp;<span style="color: red;">${page.pageNum}</span>&nbsp;/&nbsp;<b>${page.pages}</b>&nbsp;页&nbsp;&nbsp;
								总共&nbsp;<b>${page.total}</b>&nbsp;条</span>
							<nav aria-label="Page navigation" style="margin: 0 auto; width: 240px">
								<ul class="pagination" style="margin: 0;">
									<li>
										<a href="${path}/TbEva/tbEvaPage?pageNo=${page.isFirstPage?1:page.prePage}"
										   aria-label="Previous"> <span aria-hidden="true">前一页</span>
										</a>
									</li>
									<c:forEach  begin="1" end="${page.pages}" varStatus="i">
											<li><a href="${path}/TbEva/tbEvaPage?pageNo=${i.count}">${i.count}</a></li>
									</c:forEach>
									<li><a href="${path}/TbEva/tbEvaPage?pageNo=${page.isLastPage?page.pages:page.nextPage}"
										   aria-label="Next"> <span aria-hidden="true">后一页</span>
									</a></li>
								</ul>
							</nav>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 全局js -->
	<script src="${path}/js/jquery.min.js?v=2.1.4"></script>
	<script src="${path}/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="${path}/js/plugins/jeditable/jquery.jeditable.js"></script>

	<!-- Data Tables -->
	<script src="${path}/js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="${path}/js/plugins/dataTables/dataTables.bootstrap.js"></script>

	<!-- 自定义js -->
	<script src="${path}/js/content.js?v=1.0.0"></script>

 	<!-- layer javascript -->
    <script src="${path}/js/plugins/layer/layer.min.js"></script>
    
</body>
<script type="text/javascript">
	function allChecked(){
		var evaBoxs = document.getElementsByName("evaIndex");
		for (var i = 0; i <evaBoxs.length ; i++) {
			var evaBox=evaBoxs[i];
			evaBox.checked=evaBox.checked?false:true;
		}
	}

	function delChecked(){
		var evaBoxs = document.getElementsByName("evaIndex");
		var s=[];
		var count=0;
		for (var i = 0; i <evaBoxs.length ; i++) {
			var evaBox=evaBoxs[i];
			if(evaBox.checked){
				var id=evaBox.value;
				s[count]=id;
				count++;
			}
		}
		location.href="${path}/TbEva/delAllTbEva?ids="+s;
	}

	function passChecked(){
		var evaBoxs = document.getElementsByName("evaIndex");
		var s=[];
		var count=0;
		for (var i = 0; i <evaBoxs.length ; i++) {
			var evaBox=evaBoxs[i];
			if(evaBox.checked){
				var id=evaBox.value;
				s[count]=id;
				count++;
			}
		}
		location.href="${path}/TbEva/updateAllEva?ids="+s;
	}
</script>
</html>
